sysroot: Bump mtime when writing an origin file
authorColin Walters <walters@verbum.org>
Mon, 26 Feb 2018 17:26:32 +0000 (12:26 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 26 Feb 2018 19:06:59 +0000 (19:06 +0000)
This ensures that e.g. `rpm-ostreed` will get notified of the changes.

Closes: #1464
Approved by: jlebon

src/libostree/ostree-sysroot-deploy.c

index 4284b5ae91824410d329fa6f35a66d4d29988141..8fdf28a393e175bc7ded5b4fb868f591cf43e904 100644 (file)
@@ -847,7 +847,9 @@ merge_configuration (OstreeSysroot         *sysroot,
   return TRUE;
 }
 
-/* Write the origin file for a deployment. */
+/* Write the origin file for a deployment; this does not bump the mtime, under
+ * the assumption the caller may be writing multiple.
+ */
 static gboolean
 write_origin_file_internal (OstreeSysroot         *sysroot,
                             OstreeDeployment      *deployment,
@@ -903,9 +905,15 @@ ostree_sysroot_write_origin_file (OstreeSysroot         *sysroot,
                                   GCancellable          *cancellable,
                                   GError               **error)
 {
-  return write_origin_file_internal (sysroot, deployment, new_origin,
-                                     GLNX_FILE_REPLACE_DATASYNC_NEW,
-                                     cancellable, error);
+  if (!write_origin_file_internal (sysroot, deployment, new_origin,
+                                   GLNX_FILE_REPLACE_DATASYNC_NEW,
+                                   cancellable, error))
+    return FALSE;
+
+  if (!_ostree_sysroot_bump_mtime (sysroot, error))
+    return FALSE;
+
+  return TRUE;
 }
 
 typedef struct {